$(function () {
    
  $('.lt-submit').click(function () {
    var username = $('.mui-input-clear').val()
    var password = $('.mui-input-password').val()

    $.ajax({
      type: 'post',
      url: '/user/login',
      data: {
        username,
        password,
      },

      dataType: 'json',
      success: function (res) {
        if(res.success){
          
          
          if (location.href.indexOf('url')>-1){
            var key = location.href.split('?')[1]
            var site=location.href.split('?')[2]
           var key =key.split('=')[1]
           
          console.log(key);
            location.href= key+'?'+site
           }else{
            location.href= 'user.html'
          }
          

    
        }
      }
    })
  })


})